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 © 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 © 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 © 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 © 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("'", "'", $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("'", "'", $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("'", "'", $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'] . "'> 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> <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') . ' </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'])) . ' </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) . ' </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) . ' </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) . ' </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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending">';
+ $HEADING_CUSTOMERS .= ' <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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending">';
+ $HEADING_DATE_PURCHASED .= ' <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; ?> </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> ' . $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>'; } ?> </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 . ' ' . $oInfo->customers_name . '<br>');
+ $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . ' <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 . '] ' . 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'> " . $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'> $Product_Name" . $LastOptionTag . "\n";
+ }
+
+ if($Category != $LastCategory)
+ {
+ $ProductSelectOptions .= "<option value='0'> " . $LastOptionTag . "\n";
+ $ProductSelectOptions .= "<option value='0'> " . $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'> </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'> </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'> </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"> <?php echo ENTRY_GENDER; ?></td>
+ <td class="main">
+<?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) . ' ' . MALE . ' ' . tep_draw_radio_field('gender', 'f', $female) . ' ' . FEMALE . ' ' . ENTRY_GENDER_ERROR;
+ } else {
+ echo ($gender == 'm') ? MALE : FEMALE;
+ echo tep_draw_hidden_field('gender');
+ }
+ } else {
+ echo tep_draw_radio_field('gender', 'm', $male) . ' ' . MALE . ' ' . tep_draw_radio_field('gender', 'f', $female) . ' ' . FEMALE . ' ' . ENTRY_GENDER_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_FIRST_NAME; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['customers_firstname'];
+ } elseif ($error) {
+ if ($entry_firstname_error) {
+ echo tep_draw_input_field('firstname') . ' ' . ENTRY_FIRST_NAME_ERROR;
+ } else {
+ echo $firstname . tep_draw_hidden_field('firstname');
+ }
+ } else {
+ echo tep_draw_input_field('firstname', $account['customers_firstname']) . ' ' . ENTRY_FIRST_NAME_TEXT;
+ }
+?></td>
+ </tr>
+ <tr>
+ <td class="main"> <?php echo ENTRY_LAST_NAME; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['customers_lastname'];
+ } elseif ($error) {
+ if ($entry_lastname_error) {
+ echo tep_draw_input_field('lastname') . ' ' . ENTRY_LAST_NAME_ERROR;
+ } else {
+ echo $lastname . tep_draw_hidden_field('lastname');
+ }
+ } else {
+ echo tep_draw_input_field('lastname', $account['customers_lastname']) . ' ' . ENTRY_LAST_NAME_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ if (ACCOUNT_DOB == 'true') {
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+ <td class="main">
+<?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') . ' ' . 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'])) . ' ' . ENTRY_DATE_OF_BIRTH_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['customers_email_address'];
+ } elseif ($error) {
+ if ($entry_email_address_error) {
+ echo tep_draw_input_field('email_address') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR;
+ } elseif ($entry_email_address_check_error) {
+ echo tep_draw_input_field('email_address') . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+ } elseif ($entry_email_address_exists) {
+ echo tep_draw_input_field('email_address') . ' ' . 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']) . ' ' . 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"> <?php echo ENTRY_COMPANY; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['entry_company'];
+ } elseif ($error) {
+ if ($entry_company_error) {
+ echo tep_draw_input_field('company') . ' ' . ENTRY_COMPANY_ERROR;
+ } else {
+ echo $company . tep_draw_hidden_field('company');
+ }
+ } else {
+ echo tep_draw_input_field('company', $account['entry_company']) . ' ' . 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"> <?php echo ENTRY_STREET_ADDRESS; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['entry_street_address'];
+ } elseif ($error) {
+ if ($entry_street_address_error) {
+ echo tep_draw_input_field('street_address') . ' ' . 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']) . ' ' . ENTRY_STREET_ADDRESS_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ if (ACCOUNT_SUBURB == 'true') {
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_SUBURB; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['entry_suburb'];
+ } elseif ($error) {
+ if ($entry_suburb_error) {
+ echo tep_draw_input_field('suburb') . ' ' . ENTRY_SUBURB_ERROR;
+ } else {
+ echo $suburb . tep_draw_hidden_field('suburb');
+ }
+ } else {
+ echo tep_draw_input_field('suburb', $account['entry_suburb']) . ' ' . ENTRY_SUBURB_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_POST_CODE; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['entry_postcode'];
+ } elseif ($error) {
+ if ($entry_post_code_error) {
+ echo tep_draw_input_field('postcode') . ' ' . ENTRY_POST_CODE_ERROR;
+ } else {
+ echo $postcode . tep_draw_hidden_field('postcode');
+ }
+ } else {
+ echo tep_draw_input_field('postcode', $account['entry_postcode']) . ' ' . ENTRY_POST_CODE_TEXT;
+ }
+?></td>
+ </tr>
+ <tr>
+ <td class="main"> <?php echo ENTRY_CITY; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['entry_city'];
+ } elseif ($error) {
+ if ($entry_city_error) {
+ echo tep_draw_input_field('city') . ' ' . ENTRY_CITY_ERROR;
+ } else {
+ echo $city . tep_draw_hidden_field('city');
+ }
+ } else {
+ echo tep_draw_input_field('city', $account['entry_city']) . ' ' . ENTRY_CITY_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ if (ACCOUNT_STATE == 'true') {
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_STATE; ?></td>
+ <td class="main">
+<?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) . ' ' . ENTRY_STATE_ERROR;
+ } else {
+ echo tep_draw_input_field('state') . ' ' . 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'])) . ' ' . ENTRY_STATE_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td class="main">
+<?php
+ echo ENTRY_COUNTRY;
+ ?></td>
+ <td class="main">
+<?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') . ' ' . 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']) . ' ' . 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"> <?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+ <td class="main">
+<?php
+ if ($is_read_only) {
+ echo $account['customers_telephone'];
+ } elseif ($error) {
+ if ($entry_telephone_error) {
+ echo tep_draw_input_field('telephone') . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR;
+ } else {
+ echo $telephone . tep_draw_hidden_field('telephone');
+ }
+ } else {
+ echo tep_draw_input_field('telephone', $account['customers_telephone']) . ' ' . ENTRY_TELEPHONE_NUMBER_TEXT;
+ }
+?></td>
+ </tr>
+ <tr>
+ <td class="main"> <?php echo ENTRY_FAX_NUMBER; ?></td>
+ <td class="main">
+<?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']) . ' ' . 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"> <?php echo ENTRY_NEWSLETTER; ?></td>
+ <td class="main">
+<?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']) . ' ' . 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"> <?php echo ENTRY_PASSWORD; ?></td>
+ <td class="main">
+<?php
+ if ($error) {
+ if ($entry_password_error) {
+ echo tep_draw_password_field('password') . ' ' . ENTRY_PASSWORD_ERROR;
+ } else {
+ echo PASSWORD_HIDDEN . tep_draw_hidden_field('password') . tep_draw_hidden_field('confirmation');
+ }
+ } else {
+ echo tep_draw_password_field('password') . ' ' . ENTRY_PASSWORD_TEXT;
+ }
+?></td>
+ </tr>
+<?php
+ if ( (!$error) || ($entry_password_error) ) {
+?>
+ <tr>
+ <td class="main"> <?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+ <td class="main">
+<?php
+ echo tep_draw_password_field('confirmation') . ' ' . 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; ?> </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; ?> </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; ?> </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; ?> </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; ?> </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; ?> </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; ?> </nobr></td>
+ <td class="dataTableContent"><?php echo $myAccount['admin_email_address']; ?></td>
+ </tr>
+ <tr>
+ <td class="dataTableContent"><nobr><?php echo TEXT_INFO_PASSWORD; ?> </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; ?> </nobr></td>
+ <td class="dataTableContent"><?php echo $myAccount['admin_groups_name']; ?></td>
+ </tr>
+ <tr>
+ <td class="dataTableContent"><nobr><?php echo TEXT_INFO_CREATED; ?> </nobr></td>
+ <td class="dataTableContent"><?php echo $myAccount['admin_created']; ?></td>
+ </tr>
+ <tr>
+ <td class="dataTableContent"><nobr><?php echo TEXT_INFO_LOGNUM; ?> </nobr></td>
+ <td class="dataTableContent"><?php echo $myAccount['admin_lognum']; ?></td>
+ </tr>
+ <tr>
+ <td class="dataTableContent"><nobr><?php echo TEXT_INFO_LOGDATE; ?> </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 ' '; } 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> ' . 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> ');
+ break;
+ case 'check_account':
+ $heading[] = array('text' => '<b> ' . TEXT_INFO_HEADING_CONFIRM_PASSWORD . '</b>');
+
+ $contents[] = array('text' => ' ' . TEXT_INFO_INTRO_CONFIRM_PASSWORD . tep_draw_hidden_field('id_info', $myAccount['admin_id']));
+ if ($HTTP_GET_VARS['error']) {
+ $contents[] = array('text' => ' ' . 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> ');
+ break;
+ default:
+ $heading[] = array('text' => '<b> ' . 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> ');
+ if ($myAccount['admin_email_address'] == 'admin at localhost') {
+ $contents[] = array('text' => sprintf(TEXT_INFO_INTRO_DEFAULT_FIRST, $myAccount['admin_firstname']) . '<br> ');
+ } 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> ');
+ }
+
+ }
+
+ 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; ?> </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>'; } ?> </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> <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>'; ?> </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; ?> </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) . ' <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> ' . 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) . ' ' . 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> ' . 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>'; } ?> </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"> </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> ' . 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> ');
+ $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"> <?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"> </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); } ?> </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"> <?php echo TABLE_HEADING_GROUPS_NAME; ?></td>
+ <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </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"> <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>'; } ?> </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>'; ?> </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; ?> </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"> <?php echo $admin['admin_firstname']; ?> <?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>'; } ?> </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>'; ?> </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> ' . TEXT_INFO_FIRSTNAME . '<br> ' . tep_draw_input_field('admin_firstname'));
+ $contents[] = array('text' => '<br> ' . TEXT_INFO_LASTNAME . '<br> ' . tep_draw_input_field('admin_lastname'));
+ $contents[] = array('text' => '<br> ' . TEXT_INFO_EMAIL . '<br> ' . 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> ' . TEXT_INFO_GROUP . '<br> ' . 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> ' . TEXT_INFO_FIRSTNAME . '<br> ' . tep_draw_input_field('admin_firstname', $mInfo->admin_firstname));
+ $contents[] = array('text' => '<br> ' . TEXT_INFO_LASTNAME . '<br> ' . tep_draw_input_field('admin_lastname', $mInfo->admin_lastname));
+ $contents[] = array('text' => '<br> ' . TEXT_INFO_EMAIL . '<br> ' . 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> ' . TEXT_INFO_GROUP . '<br> ' . 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> ');
+ } 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> ');
+ } elseif ($HTTP_GET_VARS['gName'] == 'used') {
+ $contents[] = array('text' => TEXT_INFO_GROUPS_NAME_USED . '<br> ');
+ }
+ $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> ');
+ } elseif ($HTTP_GET_VARS['gName'] == 'used') {
+ $contents[] = array('text' => TEXT_INFO_GROUPS_NAME_USED . '<br> ');
+ }
+ $contents[] = array('align' => 'center', 'text' => TEXT_INFO_EDIT_GROUP_INTRO . '<br> <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> ');
+ } 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> ');
+ }
+ 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> ' . 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> ');
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_FULLNAME . '</b><br> ' . $mInfo->admin_firstname . ' ' . $mInfo->admin_lastname);
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_EMAIL . '</b><br> ' . $mInfo->admin_email_address);
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_GROUP . '</b>' . $mInfo->admin_groups_name);
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_CREATED . '</b><br> ' . $mInfo->admin_created);
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_MODIFIED . '</b><br> ' . $mInfo->admin_modified);
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_LOGDATE . '</b><br> ' . $mInfo->admin_logdate);
+ $contents[] = array('text' => ' <b>' . TEXT_INFO_LOGNUM . '</b>' . $mInfo->admin_lognum);
+ $contents[] = array('text' => '<br>');
+ } elseif (is_object($gInfo)) {
+ $heading[] = array('text' => '<b> ' . 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> ');
+ }
+ }
+
+ 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) . ' ' . MALE . ' ' . tep_draw_radio_field('affiliate_gender', 'f', false, $aInfo->affiliate_gender) . ' ' . 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"> </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; ?> </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> '; 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>'; } ?> </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> </b><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDPRODUCTS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?> <?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> </b><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDCATS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?> <?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)). ' <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; ?> </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> ' . $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 ' '; ?></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 ' '; ?></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>'; } ?> </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) . ' <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, ' ', '<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"> <?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"> <?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 = ' <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; ?> </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 ' ' . $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) . ' <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> ' . 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>'; } ?> </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 . ' ' . $affiliate_news_count; ?></td>
+ <td align="right" class="smallText"><?php echo ' <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>'; ?> </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)). ' <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; ?> </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> ' . $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>'; } ?> </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, ' ', '<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"> <?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"> <?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']] : ' ') . '</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; ?> </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> ' . $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>'; } ?> </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 . '] ' . 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"> <?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"> <?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> </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; ?> </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; ?> </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>'; ?> </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>'; ?> </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> <?php echo TEXT_BAD; ?> <?php for ($i=1; $i<=5; $i++) echo tep_draw_radio_field('reviews_rating', $i, '', $rInfo->reviews_rating) . ' '; 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> <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)); ?> <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; ?> </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> ' . 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>'; } ?> </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> ' . 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') . ' ' . 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;"') . ' ' .$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']) . ' ' . 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']) . ' ' . 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']); ?> </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) . ' <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']) . ' ' . $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"') . ' ';
+
+ 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 ' <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') . ' ' . tep_draw_radio_field('articles_status', '0', $out_status) . ' ' . TEXT_ARTICLE_NOT_AVAILABLE . ' ' . tep_draw_radio_field('articles_status', '1', $in_status) . ' ' . 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') . ' '; ?><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') . ' ' . 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;"') . ' ' .$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']) . ' ' . 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']) . ' ' . 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']); ?> </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']); ?> </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']); ?> </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']) . ' ' . 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) . ' <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']) . ' ' . $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"') . ' ';
+
+ 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 ' <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; ?> </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> <b>' . $topics['topics_name'] . '</b>'; ?></td>
+ <td class="dataTableContent" align="center"> </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>'; } ?> </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> ' . $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) . ' <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> ' . 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>'; } ?> </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 . ' ' . $topics_count . '<br>' . TEXT_ARTICLES . ' ' . $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> '; 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> ' . $add_str; ?> </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']) . ' ' . 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']) . ' ' . 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'] . ' > ';
+ }
+ $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) . ' ' . $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; ?> </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>'; } ?> </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) . ' <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\"> ".$articles_id[$i]." </td>\n";
+ echo "<td class=\"dataTableContent\" valign=\"top\"> ".$articles_name[$i]." </td>\n";
+ if ($Related_items)
+ {
+ echo "<td class=\"dataTableContent\"><ol>";
+ foreach ($Related_items as $display)
+ echo '<li>'. $display .' ';
+ echo"</ol></td>\n";
+ }
+ else
+ echo "<td class=\"dataTableContent\">--</td>\n";
+ echo '<td class="dataTableContent" valign="top"> <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"> <a href="' . tep_href_link(FILENAME_ARTICLES_XSELL, 'sort=1&add_related_article_ID=' . $articles_id[$i], 'NONSSL') . '">Sort</a> </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"> </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> </td>
+ <td> </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) . ' <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> </td>
+ <td bgcolor="#CCCCCC"><?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES_XSELL) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+ <td> </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') . ' ' . 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']) . ' '; ?></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']) . ' ' . 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"> </td>
+ <td class="main" align="left"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . 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') . ' ' . 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']) . ' '; ?></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']) . ' ' . 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"> </td>
+ <td class="main" align="left"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . 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; ?> </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>'; } ?> </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; ?> </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> ' . $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>'; } ?> </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 ' <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) . ' <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> <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) . ' <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; ?> </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> ' . $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> ' . $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>'; } ?> </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> ';
+ }
+ 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) . ' <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> <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) . ' <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)). ' <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; ?> </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> ' . $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) . ' <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> ' . 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> '; 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>'; } ?> </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) . ' <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("'", "'", $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("'", "'", $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("'", "'", $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'] . "'> 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> <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') . ' </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'])) . ' </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'> " . $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'> $Product_Name" . $LastOptionTag . "\n";
+ }
+
+ if($Category != $LastCategory)
+ {
+ $ProductSelectOptions .= "<option value='0'> " . $LastOptionTag . "\n";
+ $ProductSelectOptions .= "<option value='0'> " . $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'> </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'> </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'> </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; ?> </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>'; ?> </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;"') . ' ' .$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) . ' <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']) . ' ' . $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"') . ' ';
+
+ 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 ' <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') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . 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') . ' '; ?>
+ <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') . ' ' . 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') . ' ' . 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') . ' ' . 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') . ' ' . 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') . ' ' . 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') . ' ' . 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') . ' ' . 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;"') . ' ' .$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') . ' ' . 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') . ' </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') . ' <input type="checkbox" name="unlink_image" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' ' . 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') . ' </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') . ' <input type="checkbox" name="unlink_image_med" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' ' . 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') . ' </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') . ' <input type="checkbox" name="unlink_image_lrg" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_sm_1" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_xl_1" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_sm_2" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_xl_2" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_sm_3" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_xl_3" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_sm_4" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_xl_4" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_sm_5" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_xl_5" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_sm_6" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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') . ' <input type="checkbox" name="unlink_image_xl_6" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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 . ' ' . 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']) . ' ' . $values['products_options_values_name']; ?> </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"'). ' ' . 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 ' <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']) . ' ' . $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"') . ' ';
+
+ 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 ' <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; ?> </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> <b>' . $categories['categories_name'] . '</b>'; ?></td>
+ <td class="dataTableContent" align="center"> </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>'; } ?>
+ </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>'; ?>
+ <?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>'; } ?>
+ </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> ' . $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) . ' <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> ' . 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>'; } ?>
+ </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>'; ?>
+ <?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>'; } ?>
+ </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 . ' ' . $categories_count . '<br>' . TEXT_PRODUCTS . ' ' . $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> '; 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> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_product') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?>
+ </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']) . ' ' . 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']) . ' ' . 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'] . ' > ';
+ }
+ $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) . ' ' . $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 # ' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size="3"'));
+ $contents[] = array('text' => TEXT_COPYING_ATTRIBUTES_TO.' # ' . 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 ' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
+ $contents[] = array('text' => '<br>'.TEXT_DELETE_ALL_ATTRIBUTE.' ' . 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 ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+ $contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED.' ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+ // $contents[] = array('text' => ' Duplicate Attributes should be overwritten ' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
+ $contents[] = array('text' => ' '.TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN.' ' . 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 ' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
+
+ $contents[] = array('text' => '<br>'.TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS.' ' . 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' => ' Include Download Filenames ' . 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# ' . 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.'# ' . 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# ' . $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.'# ' . $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 ' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
+ $contents[] = array('text' => '<br>'.TEXT_DELETE_ALL_ATTRIBUTE.' ' . 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 ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+ $contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED.' ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+
+ //$contents[] = array('text' => ' Duplicate Attributes should be overwritten ' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
+ $contents[] = array('text' => ' '.TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN.' ' . 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 ' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
+ $contents[] = array('text' => '<br>'.TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS.' ' . 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' => ' Include Download Filenames ' . 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; ?> </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>'; } ?> </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) . ' <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; ?> </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>'; } ?> </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) . ' <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) . ' <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) . ' <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; ?> </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>'; } ?> </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 ?> </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; ?> </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; ?> </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; ?> </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; ?> </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; ?> </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) . ' ' . IMAGE_ICON_STATUS_GREEN . ' ' . tep_draw_radio_field('coupon_status', 'N', $out_status) . ' ' . 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]) . ' ' . 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]) . ' ' . 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 ' <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; ?> </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']);
+ }
+?>
+ </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) . ' <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> ' . 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>'; } ?> </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"> <?php echo $cc_split->display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?> </td>
+ <td align="right" class="smallText"> <?php echo $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], 'status=' . $status); ?> </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 . ' : ' . $coupon_name['coupon_name'] . '<br>' .
+ COUPON_AMOUNT . ' : ' . $amount . '<br>' .
+ REDEEM_DATE_LAST . ' : ' . ((isset($rInfo->redeem_date)) ? tep_date_short($rInfo->redeem_date) : '') . '<br>' .
+ COUPON_MIN_ORDER . ' : ' . $coupon_min_order . '<br>' .
+ COUPON_STARTDATE . ' : ' . tep_date_short($cInfo->coupon_start_date) . '<br>' .
+ COUPON_FINISHDATE . ' : ' . tep_date_short($cInfo->coupon_expire_date) . '<br>' .
+ COUPON_USES_COUPON . ' : ' . $cInfo->uses_per_coupon . '<br>' .
+ COUPON_USES_USER . ' : ' . $cInfo->uses_per_user . '<br>' .
+ COUPON_PRODUCTS . ' : ' . $prod_details . '<br>' .
+ COUPON_CATEGORIES . ' : ' . $cat_details . '<br>' .
+ DATE_CREATED . ' : ' . tep_date_short($cInfo->date_created) . '<br>' .
+ DATE_MODIFIED . ' : ' . 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"> <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"> <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"> <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> </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> </td>
+ <td WIDTH=10> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="right"><?php echo BUTTON_TITLE2; ?></td>
+ <td WIDTH=10> </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> </td>
+ <td WIDTH=10> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="right"><?php echo BUTTON_TITLE3; ?></td>
+ <td WIDTH=10> </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; ?> </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>'; } ?> </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']) . ' ' . 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']) . ' ' . 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 . ' '. 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']) . ' ' . 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; ?> </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>'; } ?> </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']) . ' ' . 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']) . ' ' . 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 . ' '. 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']) . ' ' . 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; ?> </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>'; } ?> </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) . ' <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 . ' ' . 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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending">';
+ $HEADING_CUSTOMERS .= ' <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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending">';
+ $HEADING_DATE_PURCHASED .= ' <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> ' . $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 . ' ' . $oInfo->customers_name . '<br>');
+ $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . ' <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 . '] ' . 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 . ' ' . 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 . ' ' . 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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending">';
+ $HEADING_CUSTOMERS .= ' <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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending">';
+ $HEADING_DATE_PURCHASED .= ' <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; ?> </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> ' . $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>'; } ?> </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 . ' ' . $oInfo->customers_name . '<br>');
+ $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . ' <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 . '] ' . 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; ?> </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>'; } ?> </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) . ' ' . MALE . ' ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE . ' ' . 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) . ' ' . MALE . ' ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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) . ' ' . ENTRY_CUSTOMERS_GROUP_RA_NO . ' ' . tep_draw_radio_field('customers_group_ra', '1', false, $cInfo->customers_group_ra) . ' ' . ENTRY_CUSTOMERS_GROUP_RA_YES . ' ' . 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) . ' ' . ENTRY_CUSTOMERS_GROUP_RA_NO . ' ' . tep_draw_radio_field('customers_group_ra', '1', false, $cInfo->customers_group_ra) . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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"') . ' ' . 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) . ' ' . 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)) . ' ' . 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) . ' ' . 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"') . ' ' . 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" => " ".$existing_customers['customers_group_name']." ");
+ ++$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' )) . ' ' . ENTRY_CUSTOMERS_PAYMENT_SET . ' ' . tep_draw_radio_field('customers_payment_settings', '0', false, (tep_not_null($cInfo->customers_payment_allowed)? '1' : '0' )) . ' ' . 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); ?>  <?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' )) . ' ' . ENTRY_CUSTOMERS_SHIPPING_SET . ' ' . tep_draw_radio_field('customers_shipment_settings', '0', false, (tep_not_null($cInfo->customers_shipment_allowed)? '1' : '0' )) . ' ' . 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); ?>  <?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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_LASTNAME .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=lastname&order=decending">';
+ $HEADING_LASTNAME .= ' <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 .= ' <img src="images/arrow_up.gif" border="0"></a>';
+ $HEADING_FIRSTNAME .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=firstname&order=decending">';
+ $HEADING_FIRSTNAME .= ' <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 .= ' <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 .= ' <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; ?> </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> <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> <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> <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> <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> <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> <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; ?> </td>
+ </td><td class="dataTableHeadingContent" align="right" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '11', '12'); ?> <br><?php echo TABLE_HEADING_ACTION; ?> </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)." </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)." </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)." </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)." </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>'; } ?> </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"> </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"> </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') .' <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') .' <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') . ' ' ; ?>
+</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> <?php echo MSG_3?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=2') . '"> '.MSG_4.' </a>'; ?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=3') . '"> '.MSG_5.' </a>'; ?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=4') . '"> '.MSG_6.'</a>'; ?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=5') . '"> '.MSG_7.'</a>'; ?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=6') . '"> '.MSG_8.'</a>'; ?>
+
+</td></tr><tr><td class="content"> <!-- Data Feeder: --> <?php echo MSG_9?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=9') . '">'.MSG_10.'</a>'; ?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=10') . '"> '.MSG_11.'</a>'; ?>
+</td></tr><tr><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=11') . '"> '.MSG_12.'</a>'; ?>
+</td></tr><tr><td> <?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 . ' ' ;
+ 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 . ' ';
+ echo '</td><td>' . ' <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 .' ';
+ echo '</td><td>' . ' <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 . ' ';
+ echo '</td><td>' . ' <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 . ' ';
+ echo '</td><td>' . ' <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 . ' ';
+ echo '</td><td>' . ' <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. ' ';
+ echo '</td><td>' . ' <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) . ' <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> ' . 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 . ' ';
+ echo '</td><td>' . ' <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 . ' ';
+ echo '</td><td>' . ' <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 . ' '; ?>
+ </td>
+ </tr>
+ <tr>
+
+ <tr>
+ <td class="main">
+ <?php echo TABLE_HEADING_FEED_FTP_SERVER . ' ';
+ echo '</td><td>' . ' <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"> <?php echo tep_draw_input_field('data_ftp_server', ($dInfo->data_ftp_server), 'size="15"'); ?> </td>
+ </tr>
+ <tr>
+ <td class="main"> <?php echo TABLE_HEADING_FEED_FTP_USER . ' ';
+ echo '</td><td>' . ' <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"> <?php echo tep_draw_input_field('data_ftp_user_name', ($dInfo->data_ftp_user_name), 'size="15"'); ?> </td>
+ </tr>
+ <tr>
+ <td class="main"> <?php echo TABLE_HEADING_FEED_FTP_PASSWORD . ' ';
+ echo '</td><td>' . ' <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"> <?php echo tep_draw_input_field('data_ftp_user_pass', ($dInfo->data_ftp_user_pass), 'size="15"'); ?> </td>
+ </tr>
+ <tr>
+ <td class="main"> <?php echo TABLE_HEADING_FEED_FTP_DIRECTORY . ' ';
+ echo '</td><td>' . ' <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"> <?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 . ' '; ?>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="main"><?php echo TABLE_HEADING_FEED_CUR . ' ';
+ echo '</td><td>' . ' <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 ' ' . tep_draw_radio_field('data_cur_use', 'true', $data_cur_use_false_status) . ' ' . TEXT_DATA_CUR_USE_FALSE . ' ' . tep_draw_radio_field('data_cur_use', 'false', $data_cur_use_true_status) . ' ' . TEXT_DATA_CUR_USE_TRUE; ?></td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TABLE_HEADING_FEED_CUR_USE . ' ';
+ echo '</td><td>' . ' <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 . ' ';
+ echo '</td><td>' . ' <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 ' ' . tep_draw_radio_field('data_convert_cur', 'false', $data_convert_cur_false_status) . ' ' . TEXT_DATA_CUR_CONVERT_FALSE . ' ' . tep_draw_radio_field('data_convert_cur', 'true', $data_convert_cur_true_status) . ' ' . 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 . ' ';
+ echo '</td><td>' . ' <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 ' ' . tep_draw_radio_field('data_lang_use', 'true', $data_lang_use_false) . ' ' . TEXT_DATA_CUR_LANG_FALSE . ' ' . tep_draw_radio_field('data_lang_use', 'false', $data_lang_use_true) . ' ' . 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 . ' ';
+ echo '</td><td>'. ' <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 . ' ';
+ echo '</td><td>' . ' <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)). ' <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"> <?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; ?> </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"> <?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) . ' <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> ' . 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>'; } ?> </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) . ' <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') . ' ' ; ?>
+</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) . ' <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) . ' <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 '' . ' <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 '' . ' <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 ' ';?>
+ <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 '' . ' <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 ' '?>
+ <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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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 '' . ' <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 ' ';?>
+ <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 '' . ' <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 ' '?>
+ <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 '' . ' <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 ' '?>
+ <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 '' . ' <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 ' ' . EASY_LABEL_LIMIT_CAT. '</b>';
+ echo ' <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 ' ';?></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 ' ' . EASY_LABEL_LIMIT_MAN . '</b>';
+ echo ' <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 ' ';?></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 ' ' . EASY_LABEL_PRODUCT_RANGE . '</b>';
+ echo ' <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 ' ';?></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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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') . ' ' . 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 '' . ' <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') . ' ' . 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; ?> </td>
+ <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_FILE_ACTION; ?> </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> <?php echo $defines[$i]['name']; ?> </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') . ' ' ; ?> </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') . ' ' ; ?>
+</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> <a href="edit_key_help.php?&help_id=7a"><!-- A. Encrypted data that is not encrypted: --><?php echo HEADING_TITLE_07a?></a>
+ <br> <a href="edit_key_help.php?&help_id=7b"><!-- B. Decrypting data that is encrypted --><?php echo HEADING_TITLE_07b?></a>
+ <br> <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>
+
+ <?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("'", "'", $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("'", "'", $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("'", "'", $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'] . "'> 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> <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') . ' </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'])) . ' </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) . ' </a>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <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'> " . $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'> $Product_Name" . $LastOptionTag . "\n";
+ }
+
+ if($Category != $LastCategory)
+ {
+ $ProductSelectOptions .= "<option value='0'> " . $LastOptionTag . "\n";
+ $ProductSelectOptions .= "<option value='0'> " . $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'> </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'> </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 . ' 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'> </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> <?php echo TEXT_DEFINE_LABEL ; ?> </td>
+ <td> <?php echo TEXT_DEFINE_TEXT ; ?> </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"> <?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>' );
+ ?> </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 ' ';
+ 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">
+ <TEXTAREA name="name_0" rows="2" cols=50></TEXTAREA>
+ </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') . ' ' ; ?>
+</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>
+
+ <?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; ?> </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>'; } ?> </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 .' '. $events['event_id'] .' '. TEXT_EVENT_DATE_ADDED .' '. $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; ?> </td>
+ <td class="main"><script language="javascript">start_date.writeControl(); start_date.dateFormat="yyyy-MM-dd";</script> <font color="red"><!-- * required --> <?php echo ERROR_REQUIRED_FIELDS?></font></td>
+ <td> </td>
+ <td class="main"><?php echo TEXT_EVENT_END; ?> </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']) . ' ' .
+ 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); ?> <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']) . ' ' . 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> <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 .' '. $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']) .'  </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"> '. TEXT_EVENT_NO_IMAGE .' '. 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"') . ' ' . 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"> </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']) . ' </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 .' '. $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"> '. TEXT_EVENT_START .' '. $HTTP_POST_VARS['start'] .' </div></td><td bgcolor="#D9DEE6" align="center" nowrap><div class="event" style="border: 1px inset #F2F4F7"> '. TEXT_EVENT_END .' '. $HTTP_POST_VARS['end'] .' </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 .' '. $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 .' <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 .' '. $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 .' '. $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 .' '. $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 .' <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"') . ' '; ?>
+ <?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 ?> <?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 ?> <?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; ?> <script language="javascript">before_date.writeControl(); before_date.dateFormat="yyyy-MM-dd";</script> <?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; ?> </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) . ' <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> ' . 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>'; } ?> </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']) . ' ' . 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']) . ' <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 . ' ' . tep_draw_input_field('categories_sort_order', '', 'size="2"'));
+ $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_STATUS . ' ' . tep_draw_radio_field('categories_status', 'on', true) . ' ' . TEXT_FAQ_CATEGORIES_STATUS_ENABLE . ' ' . 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']) . ' ' . 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']) . ' <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 . ' ' . tep_draw_input_field('categories_sort_order', $cInfo->categories_sort_order, 'size="2"'));
+ $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_STATUS . ' ' . tep_draw_radio_field('categories_status', 'on', ($cInfo->categories_status == '1') ? true : false) . ' ' . TEXT_FAQ_CATEGORIES_STATUS_ENABLE . ' ' . 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) . '
+ <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) . '
+ <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"> </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> </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; ?> </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; ?> </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)). ' <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"> </td>
+ <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+ <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </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"> </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) . ' <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> ' . 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>'; } ?> </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) . ' <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 & 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's 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's 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's 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's 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've 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's 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's 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 "When needed" 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's pages; it's huge and consists of many different environments. How you navigate the world will depend largely on which game - single player or multipayer - you're 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'angreal, Portal Stones, and the Ways. However you move around, though, you'll 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's main characters. Some of these places are ripped directly from the pages of Jordan's books, made flesh with Legend's 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'll 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 ' <a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</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/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') . ' ' ; ?>
+</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 ' ' . TEXT_CONFIGURE . tep_draw_form('run', FILENAME_DATA_ADMIN, 'page=1', 'post', '');
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . TEXT_FEED_CONFIGURE_HELP1 ;
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . tep_image_submit('button_run.gif', TEXT_SET_CATEGORIES) . '</form>';
+
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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> ' . TEXT_SET_CATEGORIES . tep_draw_form('run', FILENAME_FROOGLE_PRE1, 'action=run', 'post', '');
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . TEXT_SET_CATEGORIES_HELP1 ;
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . tep_image_submit('button_run.gif', TEXT_SET_CATEGORIES) . '</form>';
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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> ' . TEXT_FEED_PRE_FEED . tep_draw_form('run', FILENAME_FROOGLE_PRE, 'action=run', 'post', '');
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . 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') . ' ' . tep_image_submit('button_run.gif', TEXT_FEED_FROOGLE) . '</form>';
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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> ' . TEXT_FEED_RUN . tep_draw_form('run_feed', FILENAME_FROOGLE, 'action=run', 'post', '');
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . 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') . ' ' . tep_image_submit('button_run.gif', TEXT_FEED_FROOGLE);
+ echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' <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(">" => "> ", "®" => "", "®" => "", "™" => "", "" => "");
+
+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> ' . TEXT_INFO_DONE . tep_draw_form('run', FILENAME_FROOGLE_ADMIN, 'action=run', 'post', '');
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . 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> ' . TEXT_INFO_DONE . tep_draw_form('run', FILENAME_FROOGLE_ADMIN, 'action=run', 'post', '');
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . ' ' . 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; ?> </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>'; } ?> </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; ?> </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> ' . $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>'; } ?> </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 ' ' . 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; ?> </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>'; } ?> </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; ?> </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>'; } ?> </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; ?> </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>'; } ?> </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%"> </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%"> </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%"> </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 .= ') ';
+ }
+
+ $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'] . ' </td>';
+ switch (true) {
+ // show price and weight details
+ case ($show_details):
+ echo '<td class="main" valign="top">' . ' ' . $show_details . '</td></tr>';
+ echo '<tr><td> </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'] . ' </td>';
+ switch (true) {
+ // show price and weight details
+ case ($show_details):
+ echo '<td class="main" valign="top">' . ' ' . $show_details . '</td></tr>';
+ echo '<tr><td> </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'] . ': </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 .= ') ';
+ }
+ $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'] . ' ' . $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'] . ': </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 .= ') ';
+ }
+ $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'] . ' ' . $show_details;
+ echo '<br>';
+ } // EOF: while options
+/////////////////////////////////////////////////////////////////////////////////
+ } else { // count > 1
+ echo '<tr><td class="main" valign="top">' . $products_options_name['products_options_name'] . ': </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 ' ' . ATTRIBUTES_QTY_PRICE_ONETIME_TITLE . ' '; ?></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 © 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 © 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 © 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) .
+ ' ' . tep_admin_files_boxes(FILENAME_CRYPT_UPDATE, BOX_CRYPT_UPDATE, 'SSL') .
+ // ' ' . tep_admin_files_boxes(FILENAME_CRYPT_CONVERT, BOX_CRYPT_CONVERT, 'SSL') .
+ ' ' . 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 © 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 © 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 = '&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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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'] = ' <a href="' . $heading[0]['link'] . '" class="menuBoxHeadingLink">' . $heading[0]['text'] . '</a> ';
+ } else {
+ $heading[0]['text'] = ' ' . $heading[0]['text'] . ' ';
+ }
+ $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) . ' ' . $message);
+ } elseif ($type == 'warning') {
+ $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message);
+ } elseif ($type == 'success') {
+ $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . $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> ';
+ } else {
+ $display_links .= PREVNEXT_BUTTON_PREV . ' ';
+ }
+
+ $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 .= ' <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 .= ' ' . 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 © 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 ("&what=zone:5&block=1&blockcampaign=1");
+ document.write ("&exclude=" + document.phpAds_used);
+ if (document.referrer)
+ document.write ("&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&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 © 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> Portions Copyright © 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('"' => '"')) . '" action="' . tep_parse_input_field_data($action, array('"' => '"')) . '" method="' . tep_parse_input_field_data($method, array('"' => '"')) . '"';
+
+ 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 . ' ', $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'] . ' > ';
+ }
+ $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("'", "'", $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("'", "'", $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("'", ''', $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(" ", " ",preg_replace("/\.php$/", "", str_replace("_", " ", $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(" ", " ",preg_replace("/\.php$/", "", str_replace("_", " ", $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 © 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 .= ' ';
+ }
+} // 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('"' => '"'));
+ } 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 . ' ', $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 .= ' ';
+ }
+
+ $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'] . ' > ';
+ }
+ $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 © 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 .= ' ';
+ }
+} // 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('"' => '"'));
+ } 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 . ' ', $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 .= ' ';
+ }
+
+ $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'] . ' > ';
+ }
+ $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> </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> </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('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</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>';?> <?php echo '<a target=_blank href="' . tep_catalog_href_link() . '" class="bdLink" "target=_blank">';?>Catalog</a>
+ <?php echo '<a target=_blank href="http://www.creloaded.com" class="bdLink" "target=_blank">';?><?php echo SUPPORT_DESK?></a> <?php echo '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '" class="bdLink">' . HEADER_TITLE_LOGOFF . '</a>';?> </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 ("&what=zone:4&block=1&blockcampaign=1");
+ document.write ("&exclude=" + document.phpAds_used);
+ if (document.referrer)
+ document.write ("&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&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 © 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> <a href="javascript:scrollMonth(-1);" class="cal-DayLink"><</a> <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> <a href="javascript:scrollMonth(1);" class="cal-DayLink">></a> <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> <a href="javascript:'+this.varName+'.scrollMonth(-1);" class="cal-DayLink"><</a> <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> <a href="javascript:'+this.varName+'.scrollMonth(1);" class="cal-DayLink">></a> <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> & " +
+ "<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. å 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"> </td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr id="imagelistsrcrow">
+ <td class="column1"><label for="imagelistsrc">{$lang_image_list}</label></td>
+ <td colspan="2" id="imagelistsrccontainer"> </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> </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"> </td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr id="imagelistoverrow">
+ <td class="column1"><label for="imagelistover">{$lang_image_list}</label></td>
+ <td id="imagelistovercontainer"> </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"> </td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr id="imagelistoutrow">
+ <td class="column1"><label for="imagelistout">{$lang_image_list}</label></td>
+ <td id="imagelistoutcontainer"> </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"> </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, '&');
+ value = value.replace(/\"/g, '"');
+ value = value.replace(/</g, '<');
+ value = value.replace(/>/g, '>');
+
+ 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 preview 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(''', '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"> </td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr id="linklisthrefrow">
+ <td class="column1"><label for="linklisthref">{$lang_link_list}</label></td>
+ <td colspan="2" id="linklisthrefcontainer"> </td>
+ </tr>
+ <tr>
+ <td class="column1"><label for="anchorlist">{$lang_advlink_anchor_names}</label></td>
+ <td colspan="2" id="anchorlistcontainer"> </td>
+ </tr>
+ <tr>
+ <td><label id="targetlistlabel" for="targetlist">{$lang_insert_link_target}</label></td>
+ <td id="targetlistcontainer"> </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> </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"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td nowrap="nowrap"><label for="popupname">{$lang_advlink_popup_name}</label> </td>
+ <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
+ </tr>
+ <tr>
+ <td nowrap="nowrap"><label>{$lang_advlink_popup_size}</label> </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> </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;"> ';html+=title;html+=' </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;"> ';
+
+ // Add text
+ html += title;
+
+ html += ' </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"> <a href="IF_URL">IF_CAPTION</a> <span style="font-size:70%">IF_SIZE IF_DATE</span></span> ';
+//$MY_LINK_FORMAT = '<span class="filelink"><img src="'.DIR_WS_HTTP_ADMIN.'editor_url/plugins/filemanager/InsertFile/IF_ICON" alt="IF_URL" border="0"> <a href="IF_URL">IF_CAPTION</a> <span style="font-size:70%">IF_SIZE IF_DATE</span></span> ';
+
+/* 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;"> </td>
+ <td width="0px" style="display: none;"> </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 + '"> ';
+ }
+ 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; ?>&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; ?>&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"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr id="linklistrow">
+ <td><label for="linklist">{$lang_flash_list}</label></td>
+ <td id="linklistcontainer"> </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> x <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 Ü
+ 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 > 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> </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') . ' ' : $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ítejte',
+ 'im_005' => 'Vložit',
+ 'im_006' => 'Storno',
+ 'im_007' => 'Vložit',
+ 'im_008' => 'Vložit/Změnit',
+ 'im_009' => 'Vlastnosti',
+ 'im_010' => 'Vlastnosti obrázku',
+ 'im_013' => 'Vyskakovací okna',
+ 'im_014' => 'Obrázek ve vyskakovacím okně',
+ 'im_015' => 'O programu',
+ 'im_016' => 'Sekce',
+ 'im_097' => 'Chvilku strpení, nahrávám...',
+ 'im_098' => 'Otevřít sekci',
+ 'im_099' => 'Zavřít sekci',
+ //-------------------------------------------------------------------------
+ // insert/change screen - in
+ 'in_001' => 'Vložit/Změnit obrázek',
+ 'in_002' => 'Knihovna',
+ 'in_003' => 'Vyberte knihovnu obrázků',
+ 'in_004' => 'Obrázky',
+ 'in_005' => 'Náhled',
+ 'in_006' => 'Smazat obrázek',
+ 'in_007' => 'Klikněte pro zvětšení obrázku',
+ 'in_008' => 'Otevřít upload obrázku, přejmenování, nebo smazání sekce',
+ 'in_009' => 'Informace',
+ 'in_010' => 'Vyskakovací okno',
+ 'in_013' => 'Vytvoření odkazu na obrázek otvíraný v novém okně.',
+ 'in_014' => 'Odstranit odkaz na vyskakovací okno',
+ 'in_015' => 'Soubor',
+ 'in_016' => 'Přejmenovat',
+ 'in_017' => 'Přejmenovat obrázek',
+ 'in_018' => 'Upload',
+ 'in_019' => 'Uploadovat obrázek',
+ 'in_020' => 'Velikost(i)',
+ 'in_021' => 'Zaškrtněte požadované velikosti pro upload obrázků',
+ 'in_022' => 'Originál',
+ 'in_023' => 'Obrázek bude oříznut',
+ 'in_024' => 'Smazat',
+ 'in_025' => 'Adresář',
+ 'in_026' => 'Klikněte pro vytvoření adresáře',
+ 'in_027' => 'Vytvořit adresář',
+ 'in_028' => 'Šířka',
+ 'in_029' => 'Výška',
+ 'in_030' => 'Typ',
+ 'in_031' => 'Velikost',
+ 'in_032' => 'Jméno',
+ 'in_033' => 'Vytvořeno',
+ 'in_034' => 'Změněno',
+ 'in_035' => 'Informace o obrázku',
+ 'in_036' => 'Klikněte na obrázek pro zavření okna',
+ 'in_037' => 'Otočit',
+ 'in_038' => 'Automatické otočení: nastavit na EXIF informace, pro použití EXIF orientace uložené fotoaparátem. Také může být nastaveno na +180° nebo -180° pro obrázek na šířku, nebo +90° nebo -90° pro obrázek na výšku. Kladné hodnoty pro posun ve směru hodinových ručiček, záporné proti směru.',
+ 'in_041' => '',
+ 'in_042' => 'žádný',
+ 'in_043' => 'na výšku',
+ 'in_044' => '+ 90°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'na šířku',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ 'in_049' => 'fotoaparát',
+ 'in_050' => 'exif informace',
+ 'in_051' => 'POZOR: Tento obrázek je dynamický náhled vytvořený iManagerem - parametry budou ztraceny při změně obrázku.',
+ 'in_052' => 'Klikněte pro změnu náhledu vybraného obrázku',
+ 'in_053' => 'Náhodně',
+ 'in_054' => 'Je-li zaškrtnuto, bude vybrán náhodný obrázek',
+ 'in_055' => 'Zaškrtněte pro vložení náhodného obrázku',
+ 'in_056' => 'Parametry',
+ 'in_057' => 'klikněte pro nastavení parametrů na výchozí',
+ 'in_099' => 'výchozí',
+ //-------------------------------------------------------------------------
+ // properties, attributes - at
+ 'at_001' => 'Vlastnosti obrázku',
+ 'at_002' => 'Zdroj',
+ 'at_003' => 'Titulek',
+ 'at_004' => 'TITLE - titulek obrázku, zobrazí se po přejetí myší nad obrázek',
+ 'at_005' => 'Popis',
+ 'at_006' => 'ALT - alternativní text obrázku, zobrazí se při nenačtení obrázku',
+ 'at_007' => 'Styl',
+ 'at_008' => 'Ujistěte se, že zadaný styl existuje ve vaši definici stylů.',
+ 'at_009' => 'CSS-styl',
+ 'at_010' => 'Atributy',
+ 'at_011' => 'Atributy \'align\', \'border\', \'hspace\', and \'vspace\' elementu IMAGE nejsou podporovány v XHTML 1.0 Strict DTD. Použijte místo toho CSS styly.',
+ 'at_012' => 'Zarovnání',
+ 'at_013' => 'výchozí',
+ 'at_014' => 'vlevo',
+ 'at_015' => 'vpravo',
+ 'at_016' => 'nahoru',
+ 'at_017' => 'doprostřed',
+ 'at_018' => 'dolů',
+ 'at_019' => 'střed obrázku zarovnaný se středem textu',
+ 'at_020' => 'vršek obrázku zarovnaný s vrškem textu',
+ 'at_021' => 'účaří',
+ 'at_022' => 'Velikost',
+ 'at_023' => 'Šířka',
+ 'at_024' => 'Výška',
+ 'at_025' => 'Rámeček',
+ 'at_026' => 'V-odsazení',
+ 'at_027' => 'H-odsazení',
+ 'at_028' => 'Náhled',
+ 'at_029' => 'Klikněte pro vložení speciálních znaků do pole titulku',
+ 'at_030' => 'Klikněte pro vložení speciálních znaků do pole popisu',
+ 'at_031' => 'Nastavit výchozí rozměry obrázku',
+ 'at_032' => 'Záhlaví',
+ 'at_033' => 'zaškrtnuto: nastavit záhlaví obrázku / nezaškrtnuto: bez záhlaví nebo zrušení záhlaví',
+ 'at_034' => 'nastavit záhlaví obrázku',
+ 'at_099' => 'výchozí',
+ //-------------------------------------------------------------------------
+ // error messages - er
+ 'er_001' => 'Chyba',
+ 'er_002' => 'Není vybrán obrázek!',
+ 'er_003' => 'Šířka není číslo',
+ 'er_004' => 'Výška není číslo',
+ 'er_005' => 'Rámeček není číslo',
+ 'er_006' => 'Horizontální odsazení není číslo',
+ 'er_007' => 'Vertikální odsazení není číslo',
+ 'er_008' => 'Klikněte na OK pro smazání obrázku',
+ 'er_009' => 'Přejmenování náhledů není povoleno! Přejmenujte obrázek, chcete-li přejmenovat jeho náhled.',
+ 'er_010' => 'Klikněte na OK pro přejmenování obrázku na',
+ 'er_011' => 'Nové jméno je prázdné, nebo nebylo změněno!',
+ 'er_014' => 'Zadejte nové jméno souboru!',
+ 'er_015' => 'Zadejte validní jméno souboru!',
+ 'er_016' => 'Náhled není k dispozivi! Pro zapnutí náhledů nastavte velikost náhledů v konfiguračním souboru.',
+ 'er_021' => 'Klikněte na OK pro upload obrázku.',
+ 'er_022' => 'Upload obrázku - prosím vydržte...',
+ 'er_023' => 'Nebyl vybrán žádný obrázek, nebo nebyl označen žádný soubor.',
+ 'er_024' => 'Soubor',
+ 'er_025' => 'už existuje! Klikněte na OK pro přepsání...',
+ 'er_026' => 'Zadejte nové jméno souboru!',
+ 'er_027' => 'Adresár fyzicky neexistuje',
+ 'er_028' => 'Došlo k chybě při obsluze uploadu souboru. Zkuste to prosím znovu.',
+ 'er_029' => 'Špatný typ obrazového souboru',
+ 'er_030' => 'Mazání selhalo! Zkuste to prosím znovu.',
+ 'er_031' => 'Přepsat',
+ 'er_032' => 'Náhled skutečné velikosti funguje jen pro obrázky větších rozměrů jako okno náhledu',
+ 'er_033' => 'Přejmenování souboru selhalo! Zkuste to prosím znovu.',
+ 'er_034' => 'Vytvoření adresáře selhalo! Zkuste to prosím znovu.',
+ 'er_035' => 'Zvětšení není podporováno!',
+ 'er_036' => 'Chyba při vytváření seznamu obrázků!',
+ ),
+ //-------------------------------------------------------------------------
+ // 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ügen/ä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ügen',
+ 'im_006' => 'Abbrechen',
+ 'im_007' => 'Einfügen',
+ 'im_008' => 'Einfügen/ändern',
+ 'im_009' => 'Attribute',
+ 'im_010' => 'Bild Attribute',
+ 'im_013' => 'Popup',
+ 'im_014' => 'Bild PopUp',
+ 'im_015' => 'Über iBrowser',
+ 'im_016' => 'Abschnitt',
+ 'im_097' => 'Bitte warten...',
+ 'im_098' => 'Abschnitt öffnen',
+ 'im_099' => 'Abschnitt schließen',
+ //-------------------------------------------------------------------------
+ // Einfügen/change screen - in
+ 'in_001' => 'Einfügen/Bild ändern',
+ 'in_002' => 'Ordner',
+ 'in_003' => 'Ordner auswählen',
+ 'in_004' => 'Bilder',
+ 'in_005' => 'Vorschau',
+ 'in_006' => 'Bild löschen',
+ 'in_007' => 'Für Großansicht klicken',
+ 'in_008' => 'Bild hochladen, löschen oder umbenennen',
+ 'in_009' => 'Information',
+ 'in_010' => 'Popup',
+ 'in_013' => 'Erstellt einen Link zu einem im PopUp geö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öße',
+ 'in_021' => 'Gewünschte Größe',
+ 'in_022' => 'Original',
+ 'in_023' => 'Bild wird beschnitten',
+ 'in_024' => 'Löschen',
+ 'in_025' => 'Ordner',
+ 'in_026' => 'Ordner erstellen',
+ 'in_027' => 'Ordner erstellen',
+ 'in_028' => 'Breite',
+ 'in_029' => 'Höhe',
+ 'in_030' => 'Typ',
+ 'in_031' => 'Größe',
+ 'in_032' => 'Name',
+ 'in_033' => 'erstellt am',
+ 'in_034' => 'geändert am',
+ 'in_035' => 'Bild Info',
+ 'in_036' => 'Zum schließen auf das Bild klicken',
+ 'in_037' => 'Drehen',
+ 'in_038' => 'Automatisches Drehen: benutzt die exif Informationen der Kamera. +180° oder -180° für Querformat setzen, +90° oder -90° für Hochformat. Positive Werte drehen im Uhrzeigersinn, negative entgegen.',
+ 'in_041' => '',
+ 'in_042' => 'nichts',
+ 'in_043' => 'Hochformat',
+ 'in_044' => '+ 90°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'Querformat',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ 'in_049' => 'Kamera',
+ 'in_050' => 'EXIF Info',
+ 'in_051' => 'ACHTUNG: Das Bild ist ein dynamisch vom iManager generiertes Thumbnail - Einstellungen gehen bei Bildveränderungen verloren.',
+ 'in_052' => 'Bildansicht ändern',
+ 'in_053' => 'Zufall',
+ 'in_054' => 'Zufälliges Bild einfügen',
+ 'in_055' => 'Zufälliges Bild einfü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ü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ündig',
+ 'at_021' => 'Grundlinie',
+ 'at_022' => 'Größe',
+ 'at_023' => 'Breite',
+ 'at_024' => 'Höhe',
+ 'at_025' => 'Rahmen',
+ 'at_026' => 'V-Abstand',
+ 'at_027' => 'H-Abstand',
+ 'at_028' => 'Vorschau',
+ 'at_029' => 'Sonderzeichen einfügen',
+ 'at_030' => 'Sonderzeichen einfügen',
+ 'at_031' => 'Bildgröß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ählt!',
+ 'er_003' => 'Breite ist keine Zahl',
+ 'er_004' => 'Höhe ist keine Zahl',
+ 'er_005' => 'Rahmengröße ist keine Zahl',
+ 'er_006' => 'H-Abstand muss Zahl sein',
+ 'er_007' => 'V-Abstand muss Zahl sein',
+ 'er_008' => 'Mit "OK" löschen bestätigen',
+ 'er_009' => 'Umbenennen der Thumbnails ist nicht mö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ändert!',
+ 'er_014' => 'Bitte neuen Dateinamen eingeben!',
+ 'er_015' => 'Bitte gültigen Dateinamen eingeben!',
+ 'er_016' => 'Thumbnailing ist nicht aktiviert! Um Thumbnails zu erstellen, müssen Sie die Konfiguration anpassen.',
+ 'er_021' => 'Mit "OK" Bilder uploaden!',
+ 'er_022' => 'Bild wird hochgeladen - bitte warten...',
+ 'er_023' => 'Entweder kein Bild ausgewählt oder Dateigröße wurde nicht erfasst.',
+ 'er_024' => 'Datei',
+ 'er_025' => 'Datei existiert - "OK" drücken zum überschreiben',
+ 'er_026' => 'Neuen Dateinamen eingeben!',
+ 'er_027' => 'Ordner nicht vorhanden',
+ 'er_028' => 'Es ist ein Fehler während des Uploadvorganges aufgetreten. Bitte versuchen Sie es noch einmal.',
+ 'er_029' => 'Falscher Dateityp',
+ 'er_030' => 'Löschen fehlgeschlagen - Bitte noch einmal versuchen.',
+ 'er_031' => 'Überschreiben',
+ 'er_032' => 'Bilder können nur in Großansicht angezeigt werden, wenn Sie größ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öß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° or -180° for landscape, or +90° or -90° for portrait. Positive values for clockwise and negative values for counterclockwise.',
+ 'in_041' => '',
+ 'in_042' => 'none',
+ 'in_043' => 'portrait',
+ 'in_044' => '+ 90°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'landscape',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ '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ágenes',
+ 'im_002' => 'iBrowser',
+ 'im_003' => 'Menú',
+ '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ón',
+ 'im_097' => 'Cargando... Espere...',
+ 'im_098' => 'Abrir sección',
+ 'im_099' => 'Cerrar sección',
+ //-------------------------------------------------------------------------
+ // insert/change screen - in
+ 'in_001' => 'Insertar/Cambiar imagen',
+ 'in_002' => 'Librería/Directorio',
+ 'in_003' => 'Selecciona una librería o directorio',
+ 'in_004' => 'Imágenes',
+ 'in_005' => 'Vista previa',
+ 'in_006' => 'Borrar imagen',
+ 'in_007' => 'Click para ampliar la imagen',
+ 'in_008' => 'Abre la sección de subir, renombrar o borrar imagen',
+ 'in_009' => 'Informació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ño(s)',
+ 'in_021' => 'Marcar tamaño(s) deseado(s) para ser creados mientras se sube(n) la(s) imagen(es)',
+ 'in_022' => 'Original',
+ 'in_023' => 'La imagen será 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ño',
+ 'in_032' => 'Nombre',
+ 'in_033' => 'Creado',
+ 'in_034' => 'Modificado',
+ 'in_035' => 'Informació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ón EXIF almacenada por la cámara. También puede seleccionar +180° o -180° para paisaje, o +90° o -90° 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°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'paisaje',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ 'in_049' => 'cámara',
+ 'in_050' => 'exif info',
+ 'in_051' => 'ATENCIÓN: la imagen actual es una imagen en miniatura dinámica creada con iManager - los parámetros se perderán al cambiar de imagen.',
+ 'in_052' => 'Click para cambiar la vista de selección de imagen',
+ 'in_053' => 'Aleatorio',
+ 'in_054' => 'Si se marca, se insertará una imagen aleatoriamente',
+ 'in_055' => 'Marcar para insertar una imagen aleatoriamente',
+ 'in_056' => 'Parámetros',
+ 'in_057' => 'Click para inicializar los pará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ítulo',
+ 'at_004' => 'TITLE - muestra la descripción de la imagen cuando situamos el ratón encima de ésta',
+ 'at_005' => 'Descripció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ñ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ácter especial en el campo de título',
+ 'at_030' => 'Click para insertar un carácter especial en el campo de descripción',
+ 'at_031' => 'Ajusta las dimensiones de la imagen a los valores por defecto',
+ 'at_032' => 'Subtítulo',
+ 'at_033' => 'Marcado: Pone subtítulo a la imagen / Desmarcado: imagen sin subtítulo o borra el subtítulo de la imagen',
+ 'at_034' => 'Fija el subtí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úmero',
+ 'er_004' => 'El alto no es un número',
+ 'er_005' => 'El borde no es un número',
+ 'er_006' => 'El espaciado horizontal no es un número',
+ 'er_007' => 'El espaciado vertical no es un número',
+ 'er_008' => 'Click OK para borrar la imagen',
+ 'er_009' => 'El renombrado de las imágenes en miniatura no está 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álido!',
+ 'er_016' => 'La creación de imágenes en miniatura no está habilitada! Fije el tamaño de las miniaturas en el fichero de configuració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ía el archivo. Inténtelo de nuevo.',
+ 'er_029' => 'Tipo de archivo de imagen incorrecto',
+ 'er_030' => 'El borrado ha fallado! Inté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éntelo de nuevo.',
+ 'er_034' => 'La creación del directorio ha fallado! Inténtelo de nuevo.',
+ 'er_035' => 'El agrandamiento no está permitido!',
+ 'er_036' => 'Error creando la lista de imá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° ou -180° pour l\'afichage paysage, ou +90° ou -90° 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°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'paysage',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ '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à',
+ 'im_010' => 'Proprietà dell'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'immagine',
+ 'in_008' => 'Apri la sezione di caricamento, eliminazione e modifica del nome dell'immagine',
+ 'in_009' => 'Informazione',
+ 'in_010' => 'Popup',
+ 'in_013' => 'Crea un link a un'immagine che sarà 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'immagine verrà 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'immagine',
+ 'in_036' => 'Clicca sull'immagine per chiudere la finestra',
+ 'in_037' => 'Ruota',
+ 'in_038' => 'Ruota automaticamente: imposta su 'exif info' per utilizzare l'orientazione EXIF memorizzata dalla fotocamera. Puoi anche impostare +180° o -180° per foto panoramica, o +90° o -90° per ritratto (Valori positivi ruotano l'immagine in senso orario, valori negativi in senso antiorario).',
+ 'in_041' => '',
+ 'in_042' => 'nessuna',
+ 'in_043' => 'ritratto',
+ 'in_044' => '+ 90°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'panorama',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ 'in_049' => 'camera',
+ 'in_050' => 'info exif',
+ 'in_051' => 'ATTENZIONE: L'immagine corrente è una miniatura creata da iManager - i parametri saranno persi al cambio di immagine.',
+ 'in_052' => 'Clicca per passare alla 'vista immagine'',
+ 'in_053' => 'Casuale',
+ 'in_054' => 'Se spuntato, verrà inserita un'immagine casuale',
+ 'in_055' => 'Spunta per inserire un'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'immagine',
+ 'at_002' => 'Sorgente',
+ 'at_003' => 'Titolo',
+ 'at_004' => 'TITLE - mostra una descrizione dell'immagine al passaggio del mouse',
+ 'at_005' => 'Descrizione',
+ 'at_006' => 'ALT - Alternativa testuale per l'immagine,sarà mostrata o utilizzata al posto dell'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 'align', 'border', 'hspace', and 'vspace' dell'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'immagine ai valori di default',
+ 'at_032' => 'Didascalia',
+ 'at_033' => 'selezionato: seleziona la didascalia per l'immagine' / non selezionato: nessuna didascalia / rimuove la didascalia per l'immagine',
+ 'at_034' => ' didascalia dell'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'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'immagine',
+ 'er_009' => 'Non ` possibile rinominare le miniature. Rinomina le immagini originali se vuoi rinominare le miniature.',
+ 'er_010' => 'Clicca su OK per rinominare l'immagine:',
+ 'er_011' => 'Il nuovo nome è vuoto oppure non è 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 ` selezionata nessuna immagine oppure non ` stata indicata la dimensione del file.',
+ 'er_024' => 'File',
+ 'er_025' => 'esiste già! Clicca su OK per sovrascrivere il file...',
+ 'er_026' => 'Inserisci un nuovo nome per il file!',
+ 'er_027' => 'La directory non esiste',
+ 'er_028' => 'È 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'anteprima a grandezza piena funziona solo per immagini più grandi dell'immagine di anteprima',
+ 'er_033' => 'File non rinominato correttamente! Riprova.',
+ 'er_034' => 'Creazione della directory non riuscita! Riprova.',
+ 'er_035' => 'Ingrandimento dell'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° of -180° worden gezet voor landschap, of op +90° of -90° 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°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'landschap',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ '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ądarka obrazów',
+ 'im_002' => 'iBrowser',
+ 'im_003' => 'Menu',
+ 'im_004' => 'Witaj',
+ 'im_005' => 'Wstaw',
+ 'im_006' => 'Rezygnuj',
+ 'im_007' => 'Wstaw',
+ 'im_008' => 'Wstaw/zamień',
+ 'im_009' => 'Właściwości',
+ 'im_010' => 'Właściwości obrazu',
+ 'im_013' => 'Wyskakujące okno',
+ 'im_014' => 'Wyskakujący obraz',
+ 'im_015' => 'O iBrowser',
+ 'im_016' => 'Sekcja',
+ 'im_097' => 'Proszę czekać, trwa łądowanie...',
+ 'im_098' => 'Otwórz sekcję',
+ 'im_099' => 'Zamknij sekcję',
+ //-------------------------------------------------------------------------
+ // insert/change screen - in
+ 'in_001' => 'Wstaw/zamień obraz',
+ 'in_002' => 'Biblioteka',
+ 'in_003' => 'Wybierz bibliotekę obrazów',
+ 'in_004' => 'Obrazy',
+ 'in_005' => 'Podgląd',
+ 'in_006' => 'Usuń obraz',
+ 'in_007' => 'Kliknij aby powiększyć',
+ 'in_008' => 'Sekcja ładowania, zmiany nazwy i kasowania obrazów',
+ 'in_009' => 'Informacja',
+ 'in_010' => 'Wyskakujące okno',
+ 'in_013' => 'Stwórz link do obrazu otwierającego się w nowym oknie',
+ 'in_014' => 'Usuń link do wyskakującego okna',
+ 'in_015' => 'Plik',
+ 'in_016' => 'Zmień nazwę',
+ 'in_017' => 'Zmień nazwę obrazu',
+ 'in_018' => 'Załaduj',
+ 'in_019' => 'Załaduj obraz',
+ 'in_020' => 'Rozmiar',
+ 'in_021' => 'Zaznacz oczekiwany rozmiar ładowanego obrazu',
+ 'in_022' => 'Oryginał',
+ 'in_023' => 'Obraz zostanie przycięty',
+ 'in_024' => 'Usuń',
+ 'in_025' => 'Folder',
+ 'in_026' => 'Kliknij aby stworzyć folder',
+ 'in_027' => 'Stwórz folder',
+ 'in_028' => 'Szerokość',
+ 'in_029' => 'Wysokość',
+ '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ąć okno',
+ 'in_037' => 'Rotacja',
+ 'in_038' => 'Auto-rotacja: ustaw exif info, aby korzystać z informacji EXIF z aparatu cyfrowego. Można również ustawić obrót +180° lub -180° dla pejzażu i +90° lub -90° dla portretu. Positive values for clockwise and negative values for counterclockwise.',
+ 'in_041' => '',
+ 'in_042' => 'brak',
+ 'in_043' => 'portret',
+ 'in_044' => '+ 90°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'pejzaż',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ 'in_049' => 'aparat',
+ 'in_050' => 'exif info',
+ 'in_051' => 'UWAGA: Bieżący obraz jest dynamiczną miniaturą stworzoną przez iManager - parametry zostaną zagubione podczas modyfikacji obrazu.',
+ 'in_052' => 'Kliknij aby zmienić widok selekcji obrazu',
+ 'in_053' => 'Losowo',
+ 'in_054' => 'Zaznaczenie pola spowoduje wstawienie losowego obrazu',
+ 'in_055' => 'Zaznacz aby wstawić losowy obraz',
+ 'in_056' => 'Parametry',
+ 'in_057' => 'kliknij aby zresetować wartości',
+ 'in_099' => 'standardowa',
+ //-------------------------------------------------------------------------
+ // properties, attributes - at
+ 'at_001' => 'Atrybuty obrazu',
+ 'at_002' => 'Ścieżka',
+ 'at_003' => 'Tytuł',
+ 'at_004' => 'TITLE - opis obrazu pojawiający się po najechaniu myszą',
+ 'at_005' => 'Opis',
+ 'at_006' => 'ALT - tekst alternatywny wyświetlany w zastępstwie obrazu',
+ 'at_007' => 'Styl',
+ 'at_008' => 'Proszę się upewnić, że styl istnieje w arkuszu stylów!',
+ 'at_009' => 'Styl CSS',
+ 'at_010' => 'Atrybuty',
+ 'at_011' => 'Atrybuty \'align\', \'border\', \'hspace\', i \'vspace\' definiowane dla obrazu nie są wspierane w XHTML 1.0 Strict DTD. Proszę używać stylów CSS zamiast nich.',
+ 'at_012' => 'Układ',
+ 'at_013' => 'standardowy',
+ 'at_014' => 'do lewej',
+ 'at_015' => 'do prawej',
+ 'at_016' => 'do góry',
+ 'at_017' => 'do środka',
+ 'at_018' => 'do dołu',
+ 'at_019' => 'środek obrazka zrównany z sąsiadującym tekstem',
+ 'at_020' => 'góra obrazka zrównana z sąsiadującym tekstem',
+ 'at_021' => 'dół obrazka zrównany z sąsiadującym tekstem',
+ 'at_022' => 'Rozmiar',
+ 'at_023' => 'Szerokość',
+ 'at_024' => 'Wysokość',
+ 'at_025' => 'Ramka',
+ 'at_026' => 'Odległość V',
+ 'at_027' => 'Odległość H',
+ 'at_028' => 'Podgląd',
+ 'at_029' => 'Kliknij aby wprowadzić specjalny znak do pola tytułu',
+ 'at_030' => 'Kliknij aby wprowadzić specjalny znak do pola opisu',
+ 'at_031' => 'Zresetuj wymiary obrazka do standardowych wartości',
+ 'at_032' => 'Podpis',
+ 'at_033' => 'zaznaczone: podpis ustawiony / odznaczone: brak lub usunięcie podpisu',
+ 'at_034' => 'ustaw podpis',
+ 'at_099' => 'standardowy',
+ //-------------------------------------------------------------------------
+ // error messages - er
+ 'er_001' => 'Błąd',
+ 'er_002' => 'Obraz nie został zaznaczony!',
+ 'er_003' => 'Szerokość nie jest liczbą',
+ 'er_004' => 'Wysokość nie jest liczbą',
+ 'er_005' => 'Szerokość ramki nie jest liczbą',
+ 'er_006' => 'Odległość horyzontalna nie jest liczbą',
+ 'er_007' => 'Odległość wertykalna nie jest liczbą',
+ 'er_008' => 'Kliknij OK aby skasować obraz',
+ 'er_009' => 'Zmiana nazwy miniatur nie jest dozwolona! Proszę zmienić nazwę głównego obrazu.',
+ 'er_010' => 'Kliknij OK aby zmienić nazwę na',
+ 'er_011' => 'Nazwa jest pusta lub się nie zmieniła!',
+ 'er_014' => 'Proszę wprowadzić nową nazwę pliku!',
+ 'er_015' => 'Proszę wprowadzić prawidłową nazwę pliku!',
+ 'er_016' => 'Tworzenie miniatur niemożliwe! Proszę ustawić rozmiar miniatury w pliku konfiguracyjnym.',
+ 'er_021' => 'Kliknij OK aby załadować obraz(y)',
+ 'er_022' => 'Ładowanie obrazu - proszę czekać...',
+ 'er_023' => 'Żaden obraz nie został zaznaczony lub nie zdefiniowano jego wielkości',
+ 'er_024' => 'Plik',
+ 'er_025' => 'już istnieje! Naciśnij OK aby go przepisać...',
+ 'er_026' => 'Proszę wprowadzić nową nazwę pliku!',
+ 'er_027' => 'Folder fizycznie nie istnieje',
+ 'er_028' => 'Pojawił się błąd podczas ładowania pliku. Proszę spróbować ponownie.',
+ 'er_029' => 'Błędny typ pliku',
+ 'er_030' => 'Kasowanie nieudane! Proszę spróbować ponownie.',
+ 'er_031' => 'Nadpisz',
+ 'er_032' => 'Pełny rozmiar podglądu działa tylko dla obrazów większych niż podgląd',
+ 'er_033' => 'Zmiana nazwy pliku nieudana! Proszę spróbować ponownie.',
+ 'er_034' => 'Tworzenie katalogu nieudane! Proszę spróbować ponownie.',
+ 'er_035' => 'Powiększanie nie jest dozwolone!',
+ 'er_036' => 'Wystąpił błąd podczas tworzenia listy plikó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° ou -180° para tipo paisagem, ou +90° ou -90° 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°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'Paisagem',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ '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' => 'Vloit',
+ 'im_006' => 'Storno',
+ 'im_007' => 'Vloi',
+ 'im_008' => 'Vloit/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' => 'Vloi/Zmeni obrázok',
+ 'in_002' => 'Kninica',
+ 'in_003' => 'Vyberte kninicu 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' => 'Zakrtnite poadované 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 pouitie EXIF orientácie uloené fotoaparátom. Môe by tie nastavené na +180° alebo -180° pre obrázok na írku, alebo +90° alebo -90° 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°',
+ 'in_045' => '- 90°',
+ 'in_046' => 'na írku',
+ 'in_047' => '+ 180°',
+ 'in_048' => '- 180°',
+ '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 zakrtnuté, bude vybrný náhodný obrázok',
+ 'in_055' => 'Zakrtnite pre vloenie 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í myou 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 vaej 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. Pouite 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 vloenie peciálnych znakov do po¾a titulku',
+ 'at_030' => 'Kliknite pre vloenie peciálnych znakov do po¾a popisu',
+ 'at_031' => 'Nastavi východzie rozmery obrázku',
+ 'at_032' => 'Záhlavie',
+ 'at_033' => 'zakrtnuté: nastavi záhlavie obrázku / nezakrtnuté: bez záhlavia alebo zruenie 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 vydrte...',
+ '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' => 'Dolo 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 "♪" 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